package com.winit.common.cloudlink.sender;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 发送消息
 */
@Component
public class Sender {
    private static Logger logger = LoggerFactory.getLogger(Sender.class);
    @Autowired
    private AmqpTemplate rabbitTemplate;

    /**
     * 发送任务执行状态
     */
    public void sendStatusMsg(){

    }

    public void sendMsg(String exchange, JSONObject message) {
        logger.info("com.winit.common.cloudlink.sender.Sender.sendMsg map=" + message);
        this.rabbitTemplate.convertAndSend(exchange, "no-use", message);
    }
}
